
public class Cons<T> extends RecursiveList<T> {

	final T head;
	final RecursiveList<T> tail;
	
	public Cons(T item, RecursiveList<T> t){
		head = item;
		tail = t;
	}
	
	@Override
	public boolean empty() {
		return false;
	}

	@Override
	public int len() {
		return 1 + tail.len();
	}

	@Override
	public T head() {
		return head;
	}

	@Override
	public RecursiveList<T> tail() {
		return tail;
	}
	
	@Override
	public String toString(){
		return "(" + head + ", " + tail + ")";
	}

}
